<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>14_数组的删-头部删</title>
    </head>
    <body>
        <script>
            //         0 1 2 3 4 5
            // var arr = [6,1,2,3,4,5];

            // arr[0] = arr[1];
            // arr[1] = arr[2];
            // arr[2] = arr[3];
            // arr[3] = arr[4];
            // arr[4] = arr[5];

            // arr.length--;

            // console.log(arr);


             //         0 1 2 3 4 5
             var arr = [6,1,2,3,4,5];

             for(var i = 0; i < arr.length - 1; i++){
                arr[i] = arr[i + 1];
             }

             arr.length--;

             console.log(arr);








        </script>
    </body>
</html>